package com.gitee.wsl.mathematics.algebraic.op

import com.gitee.wsl.mathematics.algebraic.Algebra


/**
 * A container for trigonometric operations for specific type.
 *
 * @param T the type of element of this structure.
 */
 interface TrigonometricOperations<T> : Algebra<T> {
    /**
     * Computes the sine of [arg].
     */
     fun sin(arg: T): T

    /**
     * Computes the cosine of [arg].
     */
     fun cos(arg: T): T

    /**
     * Computes the tangent of [arg].
     */
     fun tan(arg: T): T

    /**
     * Computes the inverse sine of [arg].
     */
     fun asin(arg: T): T

    /**
     * Computes the inverse cosine of [arg].
     */
     fun acos(arg: T): T

    /**
     * Computes the inverse tangent of [arg].
     */
     fun atan(arg: T): T

     companion object {
        /**
         * The identifier of sine.
         */
         const val SIN_OPERATION: String = "sin"

        /**
         * The identifier of cosine.
         */
         const val COS_OPERATION: String = "cos"

        /**
         * The identifier of tangent.
         */
         const val TAN_OPERATION: String = "tan"

        /**
         * The identifier of inverse sine.
         */
         const val ASIN_OPERATION: String = "asin"

        /**
         * The identifier of inverse cosine.
         */
         const val ACOS_OPERATION: String = "acos"

        /**
         * The identifier of inverse tangent.
         */
         const val ATAN_OPERATION: String = "atan"
    }
}

/**
 * Check if number is an integer from platform point of view
 */
fun Number.isInteger(): Boolean = this is Int


